package com.fuxin.mywiki.controller;

import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class TestController {
    //RequestMapping能接受get和post请求
    @RequestMapping("/hello")
    public String hello() {
        return "hello";
    }

    //接受get请求
    @GetMapping("/helloGet")
    public String helloGet() {
        return "Hello World!";
    }

    //接受post请求
    @PostMapping("/helloPost")
    public String helloPost(String name) {
        return "helloPost" + name;
    }
}
